Developer Documentation

QuickTime 4 API Documentation

3D Graphics Programming with QuickDraw 3D 1.5.4

Previous | QD3D Book | Overview | Chapter Contents | Next |

Checking the Version of the 3D Viewer

Some of the features described in this chapter are available only in versions 1.1 and later of the 3D Viewer. As a result, you might need to check the version of the 3D Viewer available in the current operating environment. Version 1.1 provides the Q3ViewerGetVersion function, which you can call to determine the version of the 3D Viewer. Because this function is not available in version 1.0, however, you must first determine that it is available before you can call it. Listing 13 defines a function, MyGet3DViewerVersion , that you can use to determine which version of the 3D Viewer is installed on a computer.

Listing 13 Determining the version of the 3D Viewer

void MyGet3DViewerVersion (unsigned long *major, unsigned long *minor)
{
    unsigned long       version;

    /*Version 1.0 did not have a get version call.*/
    if ((Boolean)Q3ViewerGetVersion == kUnresolvedSymbolAddress) {
        *major = 1;
        *minor = 0;
    } else {
        version = Q3ViewerGetVersion();
        *major = version >> 16;
        *minor = version & 0xFFFF;
    }
    return;
}

MyGet3DViewerVersion first checks to see whether the Q3ViewerGetVersion function is available. If it isn't, then version 1.0 must be running. Otherwise, MyGet3DViewerVersion calls Q3ViewerGetVersion to get the current version number.


© 1997 Apple Computer, Inc.

Previous | QD3D Book | Overview | Chapter Contents | Next |